#include <iostream>
#include <string>
#include <memory>

class Computer
{
public:
    Computer() {}

    void setBoard(const std::string &board)
    {
        _board = board;
    }

    void setDisplay(const std::string &display)
    {
        _display = display;
    }

    virtual void setOS(  );

protected:
    std::string _board;
    std::string _display;
    std::string _os;
};

class MacBook : public Computer
{
public:
    void setOS() override
    {
        _os = "Mac OS x12";
    }
};

class Builder
{
public:
    virtual void builderBoard(const std::string &board) = 0;
    virtual void builderDisplay(const std::string &display) = 0;
    virtual void builderOS() = 0;
};

class MacBookBuilder : public Builder
{
public:
    MacBookBuilder()
        : _computer(new MacBook())
    {
    }
    void buildBoard(const std::string &board)
    {
        _computer->setBoard(board);
    }

    void buildDisplay(const std::string &display)
    {
        _computer->setDisplay(display);
    }

    void buildOS()
    {
        _computer->setOS();
    }

    std::shared_ptr<Computer> build()
    {
        return _computer;
    }

private:
    std::shared_ptr<Computer> _computer;
};